package com.xmy.cultivate.schedule;

import com.xmy.cultivate.service.IOrderDetailService;
import com.xmy.cultivate.service.IStudentService;
import com.xmy.cultivate.util.SpringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 从智能课所属班型更新班型
 */
public class StudentClassTypeJob implements Job {

    @Autowired
    IStudentService iStudentService = SpringUtils.getBean(IStudentService.class);	;

    private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    private void before() {
        System.out.println("更新班型任务1：开始执行-" + dateFormat.format(new Date()));
    }

    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {
        before();
        System.out.println("更新班型任务1：业务逻辑。。。");
        //iRecordCourseService = (IRecordCourseService) SpringContextJobUtil.getBean("iRecordCourseService");
        //分层调整了，这里暂时不需要
        //iStudentService.updateClassType();
        after();
    }

    private void after() {
        System.out.println("更新班型任务1：执行结束");
        System.out.println();
    }
}
